package crossover;
import util.GAConfig;
import Operations.ValuesGenerator;
public class SingleCrossOver extends CrossoverStrategy {

	private int crossoverPoint_1,crossoverPoint_2;
	
	@Override
	public int[] getCrossoverPoints(int individual1_Size,int individual2_Size) {
		
//		if(this.crossoverPoint != 0)
//			return new int[] { this.crossoverPoint };
		
		this.crossoverPoint_1 = (int) Math.floor((float) individual1_Size / (float) 2);
		this.crossoverPoint_2 = (int) Math.floor((float) individual2_Size / (float) 2);

		return new int[] { this.crossoverPoint_1,this.crossoverPoint_2 };
	}

	@Override
	public boolean getCrossoverFlag() {
		if(ValuesGenerator.getBoleean(GAConfig.crossoverRate))
			return true;
		return false;
	}
}
